<!DOCTYPE html>
            
<HTML>
<HEAD>
<meta name="booktitle" content="Developing Applications With Objective Caml" >
 <meta charset="ISO-8859-1"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<META name="GENERATOR" content="hevea 1.05-7 of 2000-02-24">
<META NAME="Author" CONTENT="Christian.Queinnec@lip6.fr">
<LINK rel=stylesheet type="text/css" href="videoc-ocda.css">
<script language="JavaScript" src="videoc.js"><!--
//--></script>
<TITLE>
 Introduction
</TITLE>
</HEAD>
<BODY class="regularBody">
<A HREF="book-ora121.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora124.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>

<H2> Introduction</H2>This chapter presents two applications which seek to illustrate the use of the
many different programming concepts presented previously in Part III.<BR>
<BR>
The first application builds a library of graphic components, <TT>Awi</TT>
(Application Window Interface). Next the library will be applied in a simple
Francs to Euros converter. The components library reacts to user input by
calling event handlers. Although this is a simple application
algorithmically, it shows the benefits of using closures to structure the
communication between components. Indeed the various event handlers share certain
values via their environment. To appreciate the construction of <TT>Awi</TT> it is
necessary to know the base library <TT>Graphics</TT> (see chapter
<A HREF="index.html#chap-PG">5</A>, page <A HREF="index.html#chap-PG">??</A>).<BR>
<BR>
The second application is a search for a least cost path in a directed graph. It uses
Dijkstra's algorithm which calculates all the least cost paths from a source node
to all the other nodes connected to this source. A cache mechanism implemented
using a table of weak pointers (see page <A HREF="book-ora089.html#sec-weak">??</A>) is used to
speed the search. The GC can free the elements of this table at any time but they
can be recalculated as necessary. The graph visualization uses the simple
button component of the <TT>Awi</TT> library for selecting the origin and
destination nodes of the path sought. We then compare the efficiency of
running the algorithm both with and without the cache. To facilitate timing measurements between the
two versions a file with the description of the graph and the origin and
destination nodes is passed as an argument to the search algorithm. Finally, a
small graphical interface will be added to the search program.<BR>
<BR>
<BR>
<BR>
<HR>
<A HREF="book-ora121.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="index.html"><IMG SRC ="contents_motif.gif" ALT="Contents"></A>
<A HREF="book-ora124.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
